﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:local="clr-namespace:C7"
	x:Class="C7.MenuModule"
    Loaded="MenuM_Loaded"
	x:Name="MenuM"
	d:DesignWidth="1900" d:DesignHeight="880" FontFamily="/C7;Component/Resources/Fonts/#Zegoe UI Semi Bold - U" FontSize="26.667">
    <UserControl.Resources>
            <Storyboard x:Key="sbCloseGlow">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbrevCloseGlow">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="-35,0,0,0"/>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbOKGlow">
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </ThicknessAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbrevOKGlow">
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0,0,-40,0"/>
            </ThicknessAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <DataTemplate x:Key="ItemTemplate1">
        	<Grid>
        		<Grid.ColumnDefinitions>
        			<ColumnDefinition Width="0.202*"/>
        			<ColumnDefinition Width="0.798*"/>
        		</Grid.ColumnDefinitions>
        		<Image x:Name="imgImage" Source="{Binding Picture}"/>
        		<Grid d:LayoutOverrides="Height" Grid.ColumnSpan="1" Grid.Column="1">
        			<Grid.RowDefinitions>
        				<RowDefinition Height="*"/>
        				<RowDefinition Height="*"/>
        			</Grid.RowDefinitions>
        			<DockPanel x:Name="dpUpper" d:LayoutOverrides="Width, Height" LastChildFill="False">
        				<TextBlock x:Name="tbName" Text="{Binding Name}" FontFamily="/C7;Component/Resources/Fonts/#Zegoe UI - U" FontSize="32" FontWeight="Bold" VerticalAlignment="Center"/>
        				<Border HorizontalAlignment="Right" VerticalAlignment="Center" DockPanel.Dock="Right" d:LayoutOverrides="Height" Background="#FFA7A7A7" CornerRadius="10">
        					<StackPanel Orientation="Horizontal" Width="193.52" Height="44.2">
        						<Image x:Name="imgFavorite" Width="25" Height="25" Source="/C7;Component/Resources/Graphics/Icons/favoriteInverted.png" Stretch="Fill" Visibility="Collapsed" VerticalAlignment="Center"/>
        						<StackPanel Orientation="Vertical" Margin="9,0,0,0">
        							<TextBlock x:Name="tbThumbsUp" Text="{Binding ThumbsUp}" Margin="0" d:LayoutOverrides="Width" HorizontalAlignment="Center" FontSize="16"/>
        							<Image Source="/C7;Component/Resources/Graphics/Icons/thumbupInverted.png" Stretch="Uniform" Width="25" Height="25" VerticalAlignment="Center"/>
        						</StackPanel>
        						<StackPanel Orientation="Vertical" Margin="9,0,0,0">
        							<TextBlock x:Name="tbThumbsDown" Text="{Binding ThumbsDown}" Margin="0" d:LayoutOverrides="Width" HorizontalAlignment="Center" Panel.ZIndex="2" FontSize="16"/>
        							<Image Source="/C7;Component/Resources/Graphics/Icons/thumbdownInverted.png" Stretch="Uniform" Width="25" Height="25" VerticalAlignment="Center"/>
        						</StackPanel>
        						<TextBlock x:Name="tbPrice" Text="{Binding Price}" Margin="24,0,0,0" d:LayoutOverrides="Width" VerticalAlignment="Center"/>
        					</StackPanel>
        				</Border>
        			</DockPanel>
        			<TextBlock x:Name="tbDescription" Text="{Binding Description}" d:LayoutOverrides="Width" TextWrapping="Wrap" Grid.Row="1" Grid.RowSpan="1" FontSize="16"/>
        		</Grid>
        	</Grid>	
			<DataTemplate.Triggers>
				<DataTrigger Binding="{Binding IsFavorite}" Value="True">
					<Setter TargetName="imgFavorite" Property="Visibility" Value="Visible" />
				</DataTrigger>
			</DataTemplate.Triggers>
        </DataTemplate>
        <Storyboard x:Key="sbPlateUp">
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(FrameworkElement.Width)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="75"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse1" Storyboard.TargetProperty="(FrameworkElement.Width)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="50"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(FrameworkElement.Height)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="75"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse1" Storyboard.TargetProperty="(FrameworkElement.Height)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="50"/>
        	</DoubleAnimationUsingKeyFrames>
        	<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grdPlate" Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)">
        		<DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static VerticalAlignment.Top}"/>
        	</ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbPlateUpRev">
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(FrameworkElement.Width)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="75"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse1" Storyboard.TargetProperty="(FrameworkElement.Width)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="50"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(FrameworkElement.Height)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="75"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse1" Storyboard.TargetProperty="(FrameworkElement.Height)">
        		<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        		<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="50"/>
        	</DoubleAnimationUsingKeyFrames>
        	<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grdPlate" Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)">
        		<DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static VerticalAlignment.Top}"/>
        		<DiscreteObjectKeyFrame KeyTime="00:00:00.6000000" Value="{x:Static VerticalAlignment.Bottom}"/>
        	</ObjectAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="spClose">
            <BeginStoryboard Storyboard="{StaticResource sbCloseGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="spClose">
            <BeginStoryboard x:Name="sbrevCloseGlow_BeginStoryboard" Storyboard="{StaticResource sbrevCloseGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="spOK">
            <BeginStoryboard Storyboard="{StaticResource sbOKGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="spOK">
            <BeginStoryboard x:Name="sbrevOKGlow_BeginStoryboard" Storyboard="{StaticResource sbrevOKGlow}"/>
        </EventTrigger>
    </UserControl.Triggers>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="0.03*"/>
            <RowDefinition Height="0.15*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="0.03*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.091*"/>
            <ColumnDefinition Width="0.9*"/>
            <ColumnDefinition Width="0.096*"/>
        </Grid.ColumnDefinitions>
        <StackPanel x:Name="spUpperControls" Margin="0,-32,0,0" VerticalAlignment="Top" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <StackPanel x:Name="spClose" HorizontalAlignment="Center" Orientation="Horizontal" d:LayoutOverrides="GridBox">
                <Image x:Name="imgClose" HorizontalAlignment="Left" VerticalAlignment="Top" Source="/C7;Component/Resources/Graphics/Icons/close.png" Height="{Binding ActualHeight, ElementName=lblClose, Mode=Default}"/>
                <Label x:Name="lblClose" Content="Close" FontFamily="/C7;Component/Resources/Fonts/#Avian" Foreground="White" VerticalAlignment="Center" Opacity="0" Margin="-33,0,0,0" FontSize="12"/>
            </StackPanel>
            <StackPanel x:Name="spOK" HorizontalAlignment="Center" Orientation="Horizontal" MouseDown="spOK_MouseDown" Margin="0,-16,0,0">
                <Label x:Name="lblOK" Content="OK" FontFamily="/C7;Component/Resources/Fonts/#Avian" Foreground="White" VerticalAlignment="Center" Opacity="0" FontSize="21.333" Margin="0,0,-40,0"/>
                <Image x:Name="imgOK" HorizontalAlignment="Left" VerticalAlignment="Top" Source="/C7;Component/Resources/Graphics/Icons/OK.png" Height="40"/>
            </StackPanel>
        </StackPanel>
        <Rectangle x:Name="rectBaseColor" StrokeThickness="2" Grid.ColumnSpan="3" Grid.RowSpan="4" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" OpacityMask="#5A000000"/>
        <Rectangle x:Name="rectBase" StrokeThickness="19" Grid.ColumnSpan="3" Grid.RowSpan="4">
            <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0.025,0.5" StartPoint="0.973,0.504">
                    <GradientStop Color="#66000000"/>
                    <GradientStop Color="#66000000" Offset="1"/>
                    <GradientStop Color="Black" Offset="0.04"/>
                    <GradientStop Color="Black" Offset="0.96"/>
                </LinearGradientBrush>
            </Rectangle.OpacityMask>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Gray" Offset="1"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Rectangle x:Name="rectBaseGradiant" StrokeThickness="19" Grid.ColumnSpan="3" Grid.RowSpan="4">
            <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0.025,0.5" StartPoint="0.973,0.504">
                    <GradientStop Color="#66000000"/>
                    <GradientStop Color="#66000000" Offset="1"/>
                    <GradientStop Color="Black" Offset="0.04"/>
                    <GradientStop Color="Black" Offset="0.96"/>
                </LinearGradientBrush>
            </Rectangle.OpacityMask>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.02,0.5" StartPoint="0.973,0.5">
                    <GradientStop Offset="1"/>
                    <GradientStop/>
                    <GradientStop Color="White" Offset="0.5"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Grid x:Name="grdHeader" Margin="0,0,0,-0.001" Grid.Column="1" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.4*"/>
                <RowDefinition Height="3*"/>
            </Grid.RowDefinitions>
            <Rectangle x:Name="rectHeader" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=tbTitle, Mode=Default}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{DynamicResource mtMenuColor}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Rectangle x:Name="rectHeaderGradiant" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=tbTitle, Mode=Default}" OpacityMask="#85000000">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.044,0.616" StartPoint="0.968,0.51" MappingMode="RelativeToBoundingBox">
                        <GradientStop Color="Black"/>
                        <GradientStop Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <TextBlock x:Name="tbTitle" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" FontFamily="/C7;Component/Resources/Fonts/#Zegoe Caps" FontSize="48" Text="{DynamicResource mtMenuTitle}" d:LayoutOverrides="HorizontalAlignment, GridBox"/>
        </Grid>
        <DockPanel x:Name="dpTinyStuff" Grid.ColumnSpan="3" Grid.RowSpan="4" LastChildFill="False" d:IsHidden="True">
            <Rectangle x:Name="rectTinyLeft" OpacityMask="#7F000000" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" Width="1" DockPanel.Dock="Right"/>
            <Rectangle x:Name="rectTinyLower" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" DockPanel.Dock="Bottom" OpacityMask="#7F000000" Height="1"/>
        </DockPanel>
        <Grid x:Name="Contents" Grid.Column="1" Grid.Row="2">
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="0.167*"/>
        		<ColumnDefinition Width="0.833*"/>
        	</Grid.ColumnDefinitions>
        	<ListBox x:Name="lbCategories" SelectionChanged="lbCategories_SelectionChanged" BorderBrush="#00828790" FontSize="21.333">
        		<ListBox.Background>
        			<SolidColorBrush/>
        		</ListBox.Background>
        	</ListBox>
        	<ListBox x:Name="lbMenuItems" Grid.Column="1" ItemTemplate="{DynamicResource ItemTemplate1}" ItemsSource="{Binding Collection}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderBrush="#00828790" PreviewMouseLeftButtonDown="lbMenuItems_PreviewMouseLeftButtonDown">
        		<ListBox.Background>
        			<SolidColorBrush/>
        		</ListBox.Background>
        	</ListBox>
        	<Grid x:Name="grdPlate" VerticalAlignment="Bottom" Height="75" Grid.Column="1" AllowDrop="True" Width="75" MouseLeftButtonDown="grdPlate_MouseLeftButtonDown" Drop="grdPlate_Drop">
        		<Ellipse x:Name="ellipse" Fill="White" Width="75" d:LayoutOverrides="HorizontalMargin" VerticalAlignment="Center" HorizontalAlignment="Center" Height="75"/>
        		<Ellipse x:Name="ellipse1" Width="50" HorizontalAlignment="Center" VerticalAlignment="Center" Height="50">
        			<Ellipse.Fill>
        				<SolidColorBrush Color="{DynamicResource mtMenuColor}"/>
        			</Ellipse.Fill>
        		</Ellipse>
        	</Grid>
        </Grid>
    </Grid>
</UserControl>